<?php

namespace Database\Seeders;

use App\Models\Admin;
use App\Models\Commission;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class AdminSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        // 创建用户
        Admin::factory(3)->create();
        $user = Admin::where('id', '1')->first();
        $user->username = 'suntao';
        $user->avatar = fake()->imageUrl('300*300');
        $user->email = 'suntao@qq.com';
        $user->role_id = 1;
        $user->status = 1;
        $user->save();

        $user = Admin::where('id', '2')->first();
        $user->username = 'wangyu';
        $user->avatar = fake()->imageUrl('300*300');
        $user->email = 'wangyu@qq.com';
        $user->role_id = 2;
        $user->status = 1;
        $user->save();


        $user = Admin::where('id', '3')->first();
        $user->username = 'miyaohua';
        $user->avatar = fake()->imageUrl('300*300');
        $user->email = 'miyaohua@qq.com';
        $user->admin_id = 2;
        $user->role_id = 2;
        $user->status = 1;
        $user->save();
    }
}
